<template>
  <div class="co_r" >
    <div class="as_head as_head2">
      <p class="co_r_font"></p>
      <div class=" submit_btn" style="margin-top: 8px" @click="goback1()">查看报告</div>
    </div>
    <div class="ex_time">
      <div class="ex_h">
        <img src=""
            style="margin-right: 7px;">答题时间
      </div>
      <div class="count_down">{{ formatNum(hour) }}:{{ formatNum(minute) }}:{{ formatNum(second) }}</div>
      <div class="fun_box">
<!--        <div class="fun_b_f">
          <img
              src=""
              alt="">
          <p class="fun_b_font">退出答题</p></div>
        <div class="fun_b_f"><img
            src=""
            alt="">
          <p class="fun_b_font">暂停</p></div>
        <div class="fun_b_f"><img
            src=""
            alt="">
          <p class="fun_b_font">计算器</p></div>-->
      </div>
    </div>
    <div class="ex_as">
      <div class="as_h"><img src="static/img/exam/exam-dati-datika.png" style="margin-right: 10px; margin-top: -2px;"> <span class="as_title">答题卡</span><span
          class="score_co">（试卷总分{{ examRecord.qstScore }}分）</span></div>
      <div class="as_br">
        <div class="as_br_box">
          <div class="as_box_md as_box_md_error"></div>
          <span class="as_b_font">答错</span></div>
        <div class="as_br_box">
          <div class="as_box_md as_box_md_right"></div>
          <span class="as_b_font">答对</span></div>
        <div class="as_br_box">
          <div class="as_box_md as_box_md1"></div>
          <span class="as_b_font">未做</span></div>
<!--        <div class="as_br_box">
          <div class="as_box_md as_box_md2"></div>
          <span class="as_b_font">标记</span></div>-->
      </div>
      <div class="as_all_ops">
        <div class="pb60">
          <div class="as_ops_box" v-for="(paperMiddle,index) in examInfo.list" :key="index">
            <div class="as_ops_md"><p class="as_o_h"><span class="as_o_title">【{{ paperMiddle.name }}】</span><span
                class="score_co">（共 <span class="c999">{{ paperMiddle.questionArr.length }}</span> 题，一共{{ paperMiddle.questionArr.length * paperMiddle.score }}分）</span></p>
              <div class="as_c_num">
<!--                <div class="as_ops_num as_ops_num1 as_ops_bg as_box_md_error">1</div>-->
<!--                <div class="as_ops_num as_ops_num1 as_ops_bg as_box_md_right">1</div>-->
                <div id="1" class="as_ops_num as_ops_num1" @click="go(qstmiddle.id)" :class="{'as_box_md_error':qstmiddle.qstStatus == 1,'as_box_md_right':qstmiddle.qstStatus == 2,'as_ops_bg':qstmiddle.signFlag}" v-for="(qstmiddle,index) in paperMiddle.questionArr" :key="index">{{ qstmiddle.num }}</div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {course} from "@/api";

export default {
  name: 'courseListContent',
  data() {
    return {
      hour: 0,
      minute: 0,
      second: 0,
      courseList: [],
      current: 1,
      size: 10,
      sellType: "",
      level: "",
      subjectId: "",
      subject1Id: "",
      pageList: [],
      pages: 0,
      page: {},
      levelFlag: false,
      orderBy: "default",
    }
  },
  components: {},
  methods: {
    goback1(){
      this.$emit('goback')
    },
    formatNum (num) {
      return num < 10 ? '0' + num : '' + num
    },
    init(){
      let hour = Math.floor((this.examRecord.testTime / 3600) % 24);
      let minute = Math.floor((this.examRecord.testTime / 60) % 60)
      let second = Math.floor(this.examRecord.testTime % 60)
      this.hour = isNaN(hour)?0:hour
      this.minute = isNaN(minute)?0:minute
      this.second = isNaN(second)?0:second
    }
  },
  mounted: function () {
    // this.init()
  },
  props:{
    examRecord: Object,
    examInfo: Object
  },
  watch: {
    examRecord: {
      deep: true,
      handler(newVal){
        this.init()
      }
    },
    examInfo: {
      deep: true,
      handler(newVal){
        console.log(newVal)
      }
    },
  },
}
</script>

<style lang="scss" scoped>
@import "../../../../public/static/exam-scss.scss";
</style>